package com.edu.app.service.impl.ai;

import com.edu.app.bean.virtualbean.customize.PoStudentModelStatus;
import com.edu.app.bean.virtualbean.customize.StudentModelStatus;
import com.edu.app.mapper.ai.SysAITeachersMapper;
import com.edu.app.model.customer.PendingActivityModel;
import com.edu.app.model.customer.RenewContractModel;
import com.edu.app.service.sys.ai.SysAITeachersService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysAITeachersServiceImpl implements SysAITeachersService {
    @Autowired
    private SysAITeachersMapper sysAITeachersMapper;

    @Override
    public List<RenewContractModel> getRenewContractModelListByUser(String username){
        List<RenewContractModel> renewContractModelList = sysAITeachersMapper.getRenewContractModelListByUser(username);
        return renewContractModelList;
    }

    @Override
    public List<RenewContractModel> getRenewContractModelListAllByUser(String username){
        List<RenewContractModel> renewContractModelList = sysAITeachersMapper.getRenewContractModelListAllByUser(username);
        return renewContractModelList;
    }

    @Override
    public List<RenewContractModel> getRenewContractModelList(){
        List<RenewContractModel> renewContractModelList = sysAITeachersMapper.getRenewContractModelList();
        return renewContractModelList;
    }

    @Override
    public PageInfo getRenewContractModelListAll(Integer currentPage, Integer pageSize){
        PageHelper.startPage(currentPage, pageSize, true);
        List<RenewContractModel> list = sysAITeachersMapper.getRenewContractModelListAll();

        PageInfo<RenewContractModel> pageInfo = new PageInfo<RenewContractModel>(list);
        return pageInfo;
    }

    @Override
    public List<PendingActivityModel> getPendingActivityModelList(){
        List<PendingActivityModel> pendingActivityModelList = sysAITeachersMapper.getPendingActivityModelList();
        return pendingActivityModelList;
    }

    @Override
    public PageInfo getMyStudentsModel(Integer currentPage, Integer pageSize, String order, String seq, String username, Integer status){
        PageHelper.startPage(currentPage, pageSize, true);
        List<StudentModelStatus> list = sysAITeachersMapper.getMyStudentsModel(username, order, seq, status);

        PageInfo<StudentModelStatus> pageInfo = new PageInfo<StudentModelStatus>(list);
        return pageInfo;
    }

    @Override
    public PageInfo getMyPoStudentsModel(Integer currentPage, Integer pageSize, String order, String seq, String username, Integer status){
        PageHelper.startPage(currentPage, pageSize, true);
        List<PoStudentModelStatus> list = sysAITeachersMapper.getMyPoStudentsModel(username, order, seq, status);

        PageInfo<PoStudentModelStatus> pageInfo = new PageInfo<PoStudentModelStatus>(list);
        return pageInfo;
    }
}
